/* s2 - find first zero byte
   Copyright (C) 2018 Ariadne Devos

   This program is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>. */

/* x86-64 benchmark results:

     name size   time
      clz   57 3.6 ns
  unroll8  134 2.2 ns
     loop   44 2.9 ns

  loop is a clear winner -- although somewhat slower than unroll8,
  it is much shorter. */
#ifdef __x86_64__
# include "loop.c"
/* Aarch64 assumptions:

   Has clz instruction, codes to 11 instructions, no external function calls. */
#elif defined(__aarch64__)
# include "clz.c"
#else
# include "loop.c"
#endif
